<%-------------------------------------------------------------------
 * 页面名称：innerPay_4.jsp
 * 功能描述：账户间交易审核失败--修改交易信息
 * Action: 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import="cn.agiledata.bank.common.util.Constant"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib prefix="ad" uri="agiledata"%>
<%
String path = request.getContextPath();
%>
<script type='text/javascript' src='<%=path%>/dwr/util.js'></script>
<script type='text/javascript' src='<%=path%>/js/ufront.js'></script>
<script type='text/javascript' src='<%=path%>/dwr/engine.js'></script>
<script type='text/javascript'
	src='<%=path%>/dwr/interface/accountTemplate.js'></script>
<script type='text/javascript'
	src='<%=path%>/js/vnv/commonForCnAmount.js'></script>
<script type='text/javascript' src='<%=path%>/js/vnv/tomoney.js'></script>
<script language="JavaScript" type="text/JavaScript">
function dosubmit(startPage){
	document.forms["0"].submit();
}
function submitProcess() {
	var formName = document.forms["0"];
	
	if(checkNecessaryInput(formName)) {
		if (formName.remark.value.length>85) {
			alert("备注长度不能大于85！");
			return;
		}
	<logic:empty name="EsPrePayTransForm" property="batchNo">
		document.forms[0].action="esPerPayTransPayUpdate.do";
	</logic:empty>
	<logic:notEmpty name="EsPrePayTransForm" property="batchNo">
		document.forms[0].action="esPerPayTransPayUpdate.do?batchNumber="+"<bean:write name="EsPrePayTransForm" property="batchNo"/>";
	</logic:notEmpty>
		dosubmit();
	}
}
function cancelTransaction() {
	var transId = document.forms[0].id.value;
	var batchType = "false";
<logic:notEmpty name="EsPrePayTransForm" property="batchNo">
	batchType = "true";
</logic:notEmpty>
	if (confirm('您确定要取消此交易吗？')) {
		location.href='<%=path%>/page/transaction/esPerPayTransPayDel.do?batchType='+batchType+'&oldStatus=<%=Constant.ES_TRANS_STATUS_REJECTED%>&transactionID='+transId;
	}
}
function submitUpdate() {
	var formName = document.forms["0"];
	
	if(checkNecessaryInput(formName)) {
	<logic:empty name="EsPrePayTransForm" property="batchNo">
		document.forms[0].action="esPerPayTransPayUpdateWithoutStatus.do";
	</logic:empty>
	<logic:notEmpty name="EsPrePayTransForm" property="batchNo">
		document.forms[0].action="esPerPayTransPayUpdateWithoutStatus.do?batchNumber="+"<bean:write name="EsPrePayTransForm" property="batchNo"/>";
	</logic:notEmpty>
		dosubmit();
	}
}

function updatePrompt(data) {
	if (data==2){
		//top.showFault('此账户没有足够资金，请重新输入！')
		alert('此账户没有足够资金，请重新输入！');
		document.forms[0].amount.value="";
    	document.forms[0].upperAmount.value="";
		return;
	}
	if (data == 1){
		//top.showFault('请输入转出金额！');
		alert('请输入付款金额！');
		document.forms[0].amount.focus();
    	document.forms[0].upperAmount.value="";
		return; 
	} 
}

function kd() {
	var ss=getObj("amount").value;
	ss = ss.replace(/ /g,"");
	if (ss=="") {
		getObj("upperAmount").value="";
		return;
	}
	
	var sDispMsg = getChineseCurrencyString(ss);
	if(sDispMsg==-1) sDispMsg="错误的金额!";
	if(sDispMsg==-2) sDispMsg="太长的金额!";
	getObj("upperAmount").value=sDispMsg;
}

function selectTradeType(assured) {
    if(assured=='true'){
    	document.getElementById("assuredInfo").style.display = "";
    	document.getElementById("unassuredInfo").style.display = "none";
    }else{
    	document.getElementById("assuredInfo").style.display = "none";
    	document.getElementById("unassuredInfo").style.display = "";
    }
}
</script>
<div id="main">
	<div class="content_right">
		<div style="width:745px;margin-left:10px;">
			<div class="titleinfo">
				网上付款
			</div>
			<div class="edit_pass">
				<table width="100%" border="0" align="center" cellpadding="5"
					cellspacing="1">
					<html:form action="/esPerPayTransPayUpdate.do" method="post">
						<html:hidden name="EsPrePayTransForm" property="id" />
						<tr>
							<td align="right" height="35px;">
								交易ID：
							</td>
							<td height="35px;">
								<bean:write name="EsPrePayTransForm" property="transId" />
							</td>
						</tr>
						<tr>
							<td width="23%" align="right" height="35px;">
								付款子账户：
							</td>
							<td width="77%" height="35px;">
								<div class="select">
									<div>
										<html:select name="EsPrePayTransForm" property="debitId">
											<html:options collection="subAccounts" property="id"
												labelProperty="accountName" />
										</html:select>
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td align="right" height="35px;">
								收款方Email或手机：
							</td>
							<td height="35px;">
								<bean:write name="EsPrePayTransForm" property="creditMsg" />
							</td>
						</tr>
						<tr>
							<td align="right" height="35px;">
								收款方名称：
							</td>
							<td height="35px;">
								<bean:write name="EsPrePayTransForm"
									property="credit.account.name" />
							</td>
						</tr>
						<tr>
							<td align="right" height="35px;">
								<span class="orang12b">*</span> 付款金额：
							</td>
							<td height="35px;">
								<logic:notPresent name="amount">
									<html:text name="EsPrePayTransForm" property="amount"
										alt="付款金额" size="50" styleClass="inputStyle"
										onblur="if(checkDecimalInput(this,0)){accountTemplate.compareAccountMoney(document.getElementById('debitId').value,this.value, updatePrompt)} ;tomoney('forms[0]','amount','hideTransAmt');kd();"
										onkeyup="kd();" onchange="kd();" />元 
			  <input type="hidden" name="hideTransAmt" value="">
								</logic:notPresent>
								<logic:present name="amount">
									<input type="hidden" name="amount"
										value="<bean:write name="amount"/>" />
									<bean:write name="amount" />
								</logic:present>
							</td>
						</tr>
						<tr>
							<td align="right" height="35px;">
								付款金额大写：
							</td>
							<td height="35px;">
								<input type="text" name="upperAmount" size="50"
									class="inputStyleNoborder" readonly />
							</td>
						</tr>
						<tr>
							<td align="right" height="35px;">
								手续费收取方法：
							</td>
							<td class="fontgraydrop14" height="35px;">
								<bean:write name="feeRatio" />
							</td>
						</tr>
						<tr>
							<td align="right" valign="top" height="35px;">
								交易模式：
							</td>
							<td valign="top" class="fontgraydrop14" height="35px;">
								<ad:TypeChange typeId="TRADE_TYPE">
									<bean:write name="EsPrePayTransForm" property="tradeType" />
								</ad:TypeChange>
								<br />
								<table width="100%" border="0" align="center" cellpadding="7"
									cellspacing="1"  style="margin:10px 0;">
									<tr>
										<td>
											<div id="assuredInfo" style="display: none;">
												<table width="100%" border="0" cellpadding="3"
													cellspacing="0">
													<tr>
														<td width="3%" height="25" valign="top"
															style="border-bottom:1px solid #ccc;"></td>
														<td width="97%" align="left" class="red12b">
															担保交易流程如下
														</td>
													</tr>
													<tr>
														<td height="25" valign="top">
															&nbsp;
														</td>
														<td align="left" class="text9green">
															1) 买家确认付款到支付网站；
														</td>
													</tr>
													<tr>
														<td height="25" valign="top">
															&nbsp;
														</td>
														<td align="left" class="text9green">
															2) 支付网站通知卖家发货；
														</td>
													</tr>
													<tr>
														<td height="25" valign="top">
															&nbsp;
														</td>
														<td align="left" class="text9green">
															3) 卖家发货；
														</td>
													</tr>
													<tr>
														<td height="25" valign="top">
															&nbsp;
														</td>
														<td align="left" class="text9green">
															4) 买家收到货物满意后通知支付网站付款到卖家。
														</td>
													</tr>
													<tr>
														<td valign="top">
															&nbsp;
														</td>
														<td align="left" class="font_gray">
															如果您在其他购物网站上看中某件商品，可与卖家取得联系，请他注册成为支付网站用户后向您发起“账户间收款”交易。
														</td>
													</tr>
												</table>
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div id="unassuredInfo" style="display: none;">
												<table width="100%" border="0" align="center"
													cellpadding="7" cellspacing="1" bgcolor="#f9e277"
													style="margin:10px 0;">
													<tr>
														<td bgcolor="#fffdf5">
															<table width="100%" border="0" cellpadding="3"
																cellspacing="0">
																<tr>
																	<td width="3%" height="25" valign="top"
																		style="border-bottom:1px solid #ccc;"></td>
																	<td width="97%" align="left" class="red12b"
																		style="border-bottom:1px solid #ccc;">
																		特别提醒
																	</td>
																</tr>
																<tr>
																	<td height="25" valign="top">
																		&nbsp;
																	</td>
																	<td align="left">
																		<span class="lan"> 此笔款项将直接进入对方账户，请确认您确实要支付此笔款项。<br>
																			支付网站不对您的此笔款项进行担保，也不对此承担任何责任。</span>
																	</td>
																</tr>
															</table>
														</td>
													</tr>
												</table>
											</div>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td align="right" height="35px;">
								商品信息：
							</td>
							<td height="35px;">
								<html:text name="EsPrePayTransForm" property="commodityInfo"
									size="50" maxlength="85" styleClass="inputStyle" />
							</td>
						</tr>
						<tr>
							<td align="right" height="35px;">
								<span class="orang12b">*</span> 资金用途：
							</td>
							<td height="35px;">
								<html:text name="EsPrePayTransForm" property="purpose"
									alt="资金用途" maxlength="85" size="50" styleClass="inputStyle" />
								<span class="font_gray">(最长85个字符) </span>
							</td>
						</tr>
						<tr>
							<td align="right" height="35px;">
								备注：
							</td>
							<td>
								<html:textarea name="EsPrePayTransForm" property="remark"
									rows="5" cols="35" style="inputStyle" />
								<span class="font_gray">(最长85个字符) </span>
							</td>
						</tr>
					</html:form>
					<logic:notEqual name="EsPrePayTransForm" property="errorMsg"
						value="">
						<tr>
							<td height="25" align="center">
								&nbsp;
								<font color="#FF0000"><bean:write
										name="EsPrePayTransForm" property="errorMsg" /> </font>
							</td>
						</tr>
					</logic:notEqual>
					<logic:present name="b2c_notavaiable">
						<tr>
							<td height="25" align="center">
								&nbsp;
								<font color="#FF0000"><bean:write name="b2c_notavaiable" />
								</font>
							</td>
						</tr>
					</logic:present>
					<tr>
						<td height="55" align="right">
							&nbsp;
						</td>
						<td>
							<logic:notEmpty name="aqb" property="batchNo">
								<html:hidden name="aqb" property="batchType" value="true" />
								<input type="button" name="btU" value="修 改" class="button_style"
									onclick="submitUpdate();"
									<logic:present name="b2c_notavaiable">disabled</logic:present> />
		    &nbsp;&nbsp;
		    </logic:notEmpty>
							<input type="button" name="btA" value="提交重审" class="button_style"
								onclick="submitProcess();"
								<logic:present name="b2c_notavaiable">disabled</logic:present> />
							&nbsp;&nbsp;
							<input type="button" name="btC" value="取 消" class="button_style"
								onclick="cancelTransaction();" />
							&nbsp;&nbsp;
							<input type="button" name="btC" value="返 回" class="button_style"
								onclick="history.back(-1);" />
						</td>
					</tr>
				</table>
				<table width="100%" border="0" align="center" cellpadding="7"
					cellspacing="1" bgcolor="#f9e277" style="margin:10px 0;">
					<tr>
						<td bgcolor="#fffdf5">
							<table width="100%" border="0" cellpadding="3" cellspacing="0">
								<tr>
									<td width="3%" height="25" valign="top"
										style="border-bottom:1px solid #ccc;"></td>
									<td width="97%" align="left" class="red12b"
										style="border-bottom:1px solid #ccc;">
										特别提醒
									</td>
								</tr>
								<tr>
									<td valign="top">
										&nbsp;
									</td>
									<td align="left" class="font_gray">
										您可以对付款信息
										<span class="lan">进行部分修改</span>！
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</div>
			<div>
			</div>
		</div>
		<script type="text/javascript" src="<%=path%>/js/layer.js"></script>
		<script language="JavaScript" type="text/JavaScript">
function closeLayer(returnValue, type){
	hideLayer();
	if(type=="amount"){
		document.forms[0].amount.value=returnValue;
		document.forms[0].amount.focus();
		kd();
	}
}

function amountSelect(){
 	agiledata.getUserInternal(amountPopup);
}
function amountPopup(data) {
  	if(data) {
	 	openLayer("<%=path%>/page/common/simpleCalculator.jsp",400,200,false);
	} else {
		location.href="<%=path%>/page/util/session_invalid.jsp";
	}      
}

//显示预先设置的金额大写
kd();

//显示预先设置的交易模式
selectTradeType('<bean:write name="EsPrePayTransForm" property="tradeType" />');
</script>